// API配置文件
const API_CONFIG = {
	// 基础域名
	BASE_URL: 'https://slvoice.igmdns.com',
	
	// API端点
	ENDPOINTS: {
		// 认证相关
		GENERATE_CAPTCHA: '/api/v1/auth/captcha',
		SEND_SMS: '/api/v1/auth/send_sms',
		LOGIN: '/api/v1/auth/login/app',
		WECHAT_LOGIN: '/api/v1/auth/login/wechat',
		// 用户相关
		STS_TOKEN: '/api/v1/user/sts_token',
		UPLOAD_AVATAR: '/api/v1/user/upload_avatar',
		USER_PROFILE: '/api/v1/user/profile',
		USER_INFO: '/api/v1/user/info',
		USER_FRIENDS: '/api/v1/user/friends',
		// 资源包相关
		PACKAGE_LIST: '/api/v1/package/list',
		PACKAGE_PURCHASE: '/api/v1/package/purchase',
		// 支付相关
		GOLDBEAN_PAYMENT: '/api/v1/payment/goldbean',
		// 激励视频相关
		AD_REWARD: '/api/v1/adreward/adpid',
		AD_CLAIM: '/api/v1/adreward/claim',
		// 卡密相关
		CARDKEY_EXCHANGE: '/api/v1/cardkey/exchange',
		// 搜题相关
		SOLVE_IMAGE: '/api/v1/solve/image',
		SOLVE_LOGS: '/api/v1/solve/logs',
		// 题库相关
		BANK_QUESTIONS: '/api/v1/bank/questions',
		// 公共配置相关
		PUBLIC_CONFIG: '/api/v1/public/config',
		// 红包相关
		REDPACKET_CONFIG: '/api/v1/redpacket/config',
		REDPACKET_EXCHANGE: '/api/v1/redpacket/exchange',
		REDPACKET_LIST: '/api/v1/redpacket/list',
		// 代理商相关
		AGENT_APPLY: '/api/v1/agent/apply',
		AGENT_RECHARGE: '/api/v1/agent/recharge',
		AGENT_CARDKEY_GENERATE: '/api/v1/agent/cardkey/generate',
		AGENT_CARDKEY_LIST: '/api/v1/agent/cardkey/list',
		// 钱包相关
		WALLET_LOGS: '/api/v1/wallet/my/logs',
		// SVIP相关
		SVIP_STATUS: '/api/v1/svip/status',
		SVIP_OPEN_PAY: '/api/v1/svip/open/pay',
		SVIP_CLAIM: '/api/v1/svip/claim'
	}
}

// 获取完整的API URL
export function getApiUrl(endpoint) {
	return API_CONFIG.BASE_URL + endpoint
}

// 获取认证相关API URL
export const AUTH_API = {
	GENERATE_CAPTCHA: getApiUrl(API_CONFIG.ENDPOINTS.GENERATE_CAPTCHA),
	SEND_SMS: getApiUrl(API_CONFIG.ENDPOINTS.SEND_SMS),
	LOGIN: getApiUrl(API_CONFIG.ENDPOINTS.LOGIN),
	WECHAT_LOGIN: getApiUrl(API_CONFIG.ENDPOINTS.WECHAT_LOGIN)
}

// 获取用户相关API URL
export const USER_API = {
	STS_TOKEN: getApiUrl(API_CONFIG.ENDPOINTS.STS_TOKEN),
	UPLOAD_AVATAR: getApiUrl(API_CONFIG.ENDPOINTS.UPLOAD_AVATAR),
	USER_PROFILE: getApiUrl(API_CONFIG.ENDPOINTS.USER_PROFILE),
	USER_INFO: getApiUrl(API_CONFIG.ENDPOINTS.USER_INFO),
	USER_FRIENDS: getApiUrl(API_CONFIG.ENDPOINTS.USER_FRIENDS)
}

// 获取资源包相关API URL
export const PACKAGE_API = {
	LIST: getApiUrl(API_CONFIG.ENDPOINTS.PACKAGE_LIST),
	PURCHASE: getApiUrl(API_CONFIG.ENDPOINTS.PACKAGE_PURCHASE)
}

// 获取支付相关API URL
export const PAYMENT_API = {
	GOLDBEAN_PAYMENT: getApiUrl(API_CONFIG.ENDPOINTS.GOLDBEAN_PAYMENT)
}

// 获取激励视频相关API URL
export const AD_API = {
	REWARD: getApiUrl(API_CONFIG.ENDPOINTS.AD_REWARD),
	CLAIM: getApiUrl(API_CONFIG.ENDPOINTS.AD_CLAIM)
}

// 获取卡密相关API URL
export const CARDKEY_API = {
	EXCHANGE: getApiUrl(API_CONFIG.ENDPOINTS.CARDKEY_EXCHANGE)
}

// 获取搜题相关API URL
export const SOLVE_API = {
	IMAGE: getApiUrl(API_CONFIG.ENDPOINTS.SOLVE_IMAGE),
	LOGS: getApiUrl(API_CONFIG.ENDPOINTS.SOLVE_LOGS)
}

// 获取题库相关API URL
export const BANK_API = {
	QUESTIONS: getApiUrl(API_CONFIG.ENDPOINTS.BANK_QUESTIONS)
}

// 获取公共配置相关API URL
export const PUBLIC_API = {
	CONFIG: getApiUrl(API_CONFIG.ENDPOINTS.PUBLIC_CONFIG)
}

// 获取红包相关API URL
export const REDPACKET_API = {
	CONFIG: getApiUrl(API_CONFIG.ENDPOINTS.REDPACKET_CONFIG),
	EXCHANGE: getApiUrl(API_CONFIG.ENDPOINTS.REDPACKET_EXCHANGE),
	LIST: getApiUrl(API_CONFIG.ENDPOINTS.REDPACKET_LIST)
}

// 获取代理商相关API URL
export const AGENT_API = {
	APPLY: getApiUrl(API_CONFIG.ENDPOINTS.AGENT_APPLY),
	RECHARGE: getApiUrl(API_CONFIG.ENDPOINTS.AGENT_RECHARGE),
	CARDKEY_GENERATE: getApiUrl(API_CONFIG.ENDPOINTS.AGENT_CARDKEY_GENERATE),
  CARDKEY_LIST: getApiUrl(API_CONFIG.ENDPOINTS.AGENT_CARDKEY_LIST)
}

// 获取钱包相关API URL
export const WALLET_API = {
	LOGS: getApiUrl(API_CONFIG.ENDPOINTS.WALLET_LOGS)
}

// 获取SVIP相关API URL
export const SVIP_API = {
	STATUS: getApiUrl(API_CONFIG.ENDPOINTS.SVIP_STATUS),
	OPEN_PAY: getApiUrl(API_CONFIG.ENDPOINTS.SVIP_OPEN_PAY),
	CLAIM: getApiUrl(API_CONFIG.ENDPOINTS.SVIP_CLAIM)
}

// 导出配置
export default API_CONFIG
